package com.fa4j.product.stock.controller;

import com.fa4j.common.base.model.Page;
import com.fa4j.common.web.annotation.ApiMethod;
import com.fa4j.common.web.model.AppType;
import com.fa4j.product.stock.model.StockRecord;
import com.fa4j.product.stock.model.StockRecordPageQuery;
import com.fa4j.product.stock.repository.StockRecordRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Web接口-商品库存记录
 *
 * @since 2025-11-22 21:06:24
 */
@RestController
@RequestMapping("product/stock")
@RequiredArgsConstructor
public class StockRecordController {

    private final StockRecordRepository stockRecordRepository;


    @GetMapping("page")
    @ApiMethod(name = "商品库存记录-分页查询", type = AppType.MANAGE)
    public Page<StockRecord> page(StockRecordPageQuery query) {
        return stockRecordRepository.queryPage(query);
    }
}

